<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        {:build_toolbar('refresh')}
                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-edit="{:$auth->check('scanwork/product_item/edit')}" 
                           data-operate-del="{:$auth->check('scanwork/product_item/del')}" 
                           width="100%">
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var Table = $("#table").bootstrapTable({
        url: 'scanwork/product_item/index',
        pk: 'id',
        sortName: 'id',
        sortOrder: 'desc',
        columns: [
            [
                {checkbox: true},
                {field: 'id', title: __('ID'), width: 80},
                {field: 'item_no', title: __('产品编号'), width: 150},
                {field: 'allocation.order.order_no', title: __('订单号'), width: 150},
                {field: 'allocation.model.product.name', title: __('产品名称'), width: 120},
                {field: 'allocation.model.name', title: __('型号'), width: 100},
                {field: 'allocation.process.name', title: __('工序'), width: 100},
                {field: 'allocation.user.nickname', title: __('员工'), width: 100},
                {field: 'status', title: __('状态'), width: 100, formatter: Table.api.formatter.status},
                {field: 'report.createtime', title: __('报工时间'), width: 150, formatter: Table.api.formatter.datetime},
                {field: 'audit_user.nickname', title: __('审核人'), width: 100},
                {field: 'audit_time', title: __('审核时间'), width: 150, formatter: Table.api.formatter.datetime},
                {field: 'operate', title: __('操作'), width: 200, table: Table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
            ]
        ],
        operate: {
            view: {
                title: __('查看'),
                icon: 'fa fa-eye',
                class: 'btn btn-xs btn-info btn-dialog',
                url: 'scanwork/product_item/view'
            }
        }
    });
</script> 